/*
 * XML Type:  Responsibility
 * Namespace: http:///org/isistan/flabot/coremodel.ecore
 * Java type: org.isistan.flabot.coremodelEcore.Responsibility
 *
 * Automatically generated - do not modify.
 */
package org.isistan.flabot.coremodelEcore.impl;
/**
 * An XML Responsibility(@http:///org/isistan/flabot/coremodel.ecore).
 *
 * This is a complex type.
 */
public class ResponsibilityImpl extends org.isistan.flabot.coremodelEcore.impl.BehavioralFeatureModelImpl implements org.isistan.flabot.coremodelEcore.Responsibility
{
    private static final long serialVersionUID = 1L;
    
    public ResponsibilityImpl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }
    
    private static final javax.xml.namespace.QName PRECONDITIONS$0 = 
        new javax.xml.namespace.QName("", "preconditions");
    private static final javax.xml.namespace.QName POSTCONDITIONS$2 = 
        new javax.xml.namespace.QName("", "postconditions");
    private static final javax.xml.namespace.QName COREMODEL$4 = 
        new javax.xml.namespace.QName("", "coreModel");
    private static final javax.xml.namespace.QName DESCRIPTION$6 = 
        new javax.xml.namespace.QName("", "description");
    private static final javax.xml.namespace.QName PRECONDITIONS2$8 = 
        new javax.xml.namespace.QName("", "preconditions");
    private static final javax.xml.namespace.QName POSTCONDITIONS2$10 = 
        new javax.xml.namespace.QName("", "postconditions");
    private static final javax.xml.namespace.QName COREMODEL2$12 = 
        new javax.xml.namespace.QName("", "coreModel");
    
    
    /**
     * Gets array of all "preconditions" elements
     */
    public org.isistan.flabot.coremodelEcore.Condition[] getPreconditionsArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            java.util.List targetList = new java.util.ArrayList();
            get_store().find_all_element_users(PRECONDITIONS2$8, targetList);
            org.isistan.flabot.coremodelEcore.Condition[] result = new org.isistan.flabot.coremodelEcore.Condition[targetList.size()];
            targetList.toArray(result);
            return result;
        }
    }
    
    /**
     * Gets ith "preconditions" element
     */
    public org.isistan.flabot.coremodelEcore.Condition getPreconditionsArray(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.isistan.flabot.coremodelEcore.Condition target = null;
            target = (org.isistan.flabot.coremodelEcore.Condition)get_store().find_element_user(PRECONDITIONS2$8, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            return target;
        }
    }
    
    /**
     * Returns number of "preconditions" element
     */
    public int sizeOfPreconditionsArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(PRECONDITIONS2$8);
        }
    }
    
    /**
     * Sets array of all "preconditions" element  WARNING: This method is not atomicaly synchronized.
     */
    public void setPreconditionsArray(org.isistan.flabot.coremodelEcore.Condition[] preconditionsArray)
    {
        check_orphaned();
        arraySetterHelper(preconditionsArray, PRECONDITIONS2$8);
    }
    
    /**
     * Sets ith "preconditions" element
     */
    public void setPreconditionsArray(int i, org.isistan.flabot.coremodelEcore.Condition preconditions)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.isistan.flabot.coremodelEcore.Condition target = null;
            target = (org.isistan.flabot.coremodelEcore.Condition)get_store().find_element_user(PRECONDITIONS2$8, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            target.set(preconditions);
        }
    }
    
    /**
     * Inserts and returns a new empty value (as xml) as the ith "preconditions" element
     */
    public org.isistan.flabot.coremodelEcore.Condition insertNewPreconditions(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.isistan.flabot.coremodelEcore.Condition target = null;
            target = (org.isistan.flabot.coremodelEcore.Condition)get_store().insert_element_user(PRECONDITIONS2$8, i);
            return target;
        }
    }
    
    /**
     * Appends and returns a new empty value (as xml) as the last "preconditions" element
     */
    public org.isistan.flabot.coremodelEcore.Condition addNewPreconditions()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.isistan.flabot.coremodelEcore.Condition target = null;
            target = (org.isistan.flabot.coremodelEcore.Condition)get_store().add_element_user(PRECONDITIONS2$8);
            return target;
        }
    }
    
    /**
     * Removes the ith "preconditions" element
     */
    public void removePreconditions(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(PRECONDITIONS2$8, i);
        }
    }
    
    /**
     * Gets array of all "postconditions" elements
     */
    public org.isistan.flabot.coremodelEcore.Condition[] getPostconditionsArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            java.util.List targetList = new java.util.ArrayList();
            get_store().find_all_element_users(POSTCONDITIONS2$10, targetList);
            org.isistan.flabot.coremodelEcore.Condition[] result = new org.isistan.flabot.coremodelEcore.Condition[targetList.size()];
            targetList.toArray(result);
            return result;
        }
    }
    
    /**
     * Gets ith "postconditions" element
     */
    public org.isistan.flabot.coremodelEcore.Condition getPostconditionsArray(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.isistan.flabot.coremodelEcore.Condition target = null;
            target = (org.isistan.flabot.coremodelEcore.Condition)get_store().find_element_user(POSTCONDITIONS2$10, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            return target;
        }
    }
    
    /**
     * Returns number of "postconditions" element
     */
    public int sizeOfPostconditionsArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(POSTCONDITIONS2$10);
        }
    }
    
    /**
     * Sets array of all "postconditions" element  WARNING: This method is not atomicaly synchronized.
     */
    public void setPostconditionsArray(org.isistan.flabot.coremodelEcore.Condition[] postconditionsArray)
    {
        check_orphaned();
        arraySetterHelper(postconditionsArray, POSTCONDITIONS2$10);
    }
    
    /**
     * Sets ith "postconditions" element
     */
    public void setPostconditionsArray(int i, org.isistan.flabot.coremodelEcore.Condition postconditions)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.isistan.flabot.coremodelEcore.Condition target = null;
            target = (org.isistan.flabot.coremodelEcore.Condition)get_store().find_element_user(POSTCONDITIONS2$10, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            target.set(postconditions);
        }
    }
    
    /**
     * Inserts and returns a new empty value (as xml) as the ith "postconditions" element
     */
    public org.isistan.flabot.coremodelEcore.Condition insertNewPostconditions(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.isistan.flabot.coremodelEcore.Condition target = null;
            target = (org.isistan.flabot.coremodelEcore.Condition)get_store().insert_element_user(POSTCONDITIONS2$10, i);
            return target;
        }
    }
    
    /**
     * Appends and returns a new empty value (as xml) as the last "postconditions" element
     */
    public org.isistan.flabot.coremodelEcore.Condition addNewPostconditions()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.isistan.flabot.coremodelEcore.Condition target = null;
            target = (org.isistan.flabot.coremodelEcore.Condition)get_store().add_element_user(POSTCONDITIONS2$10);
            return target;
        }
    }
    
    /**
     * Removes the ith "postconditions" element
     */
    public void removePostconditions(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(POSTCONDITIONS2$10, i);
        }
    }
    
    /**
     * Gets array of all "coreModel" elements
     */
    public org.isistan.flabot.coremodelEcore.CoreModel[] getCoreModelArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            java.util.List targetList = new java.util.ArrayList();
            get_store().find_all_element_users(COREMODEL2$12, targetList);
            org.isistan.flabot.coremodelEcore.CoreModel[] result = new org.isistan.flabot.coremodelEcore.CoreModel[targetList.size()];
            targetList.toArray(result);
            return result;
        }
    }
    
    /**
     * Gets ith "coreModel" element
     */
    public org.isistan.flabot.coremodelEcore.CoreModel getCoreModelArray(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.isistan.flabot.coremodelEcore.CoreModel target = null;
            target = (org.isistan.flabot.coremodelEcore.CoreModel)get_store().find_element_user(COREMODEL2$12, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            return target;
        }
    }
    
    /**
     * Returns number of "coreModel" element
     */
    public int sizeOfCoreModelArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(COREMODEL2$12);
        }
    }
    
    /**
     * Sets array of all "coreModel" element  WARNING: This method is not atomicaly synchronized.
     */
    public void setCoreModelArray(org.isistan.flabot.coremodelEcore.CoreModel[] coreModelArray)
    {
        check_orphaned();
        arraySetterHelper(coreModelArray, COREMODEL2$12);
    }
    
    /**
     * Sets ith "coreModel" element
     */
    public void setCoreModelArray(int i, org.isistan.flabot.coremodelEcore.CoreModel coreModel)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.isistan.flabot.coremodelEcore.CoreModel target = null;
            target = (org.isistan.flabot.coremodelEcore.CoreModel)get_store().find_element_user(COREMODEL2$12, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            target.set(coreModel);
        }
    }
    
    /**
     * Inserts and returns a new empty value (as xml) as the ith "coreModel" element
     */
    public org.isistan.flabot.coremodelEcore.CoreModel insertNewCoreModel(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.isistan.flabot.coremodelEcore.CoreModel target = null;
            target = (org.isistan.flabot.coremodelEcore.CoreModel)get_store().insert_element_user(COREMODEL2$12, i);
            return target;
        }
    }
    
    /**
     * Appends and returns a new empty value (as xml) as the last "coreModel" element
     */
    public org.isistan.flabot.coremodelEcore.CoreModel addNewCoreModel()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.isistan.flabot.coremodelEcore.CoreModel target = null;
            target = (org.isistan.flabot.coremodelEcore.CoreModel)get_store().add_element_user(COREMODEL2$12);
            return target;
        }
    }
    
    /**
     * Removes the ith "coreModel" element
     */
    public void removeCoreModel(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(COREMODEL2$12, i);
        }
    }
    
    /**
     * Gets the "description" attribute
     */
    public java.lang.String getDescription()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(DESCRIPTION$6);
            if (target == null)
            {
                return null;
            }
            return target.getStringValue();
        }
    }
    
    /**
     * Gets (as xml) the "description" attribute
     */
    public org.apache.xmlbeans.XmlString xgetDescription()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_attribute_user(DESCRIPTION$6);
            return target;
        }
    }
    
    /**
     * True if has "description" attribute
     */
    public boolean isSetDescription()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().find_attribute_user(DESCRIPTION$6) != null;
        }
    }
    
    /**
     * Sets the "description" attribute
     */
    public void setDescription(java.lang.String description)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(DESCRIPTION$6);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(DESCRIPTION$6);
            }
            target.setStringValue(description);
        }
    }
    
    /**
     * Sets (as xml) the "description" attribute
     */
    public void xsetDescription(org.apache.xmlbeans.XmlString description)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_attribute_user(DESCRIPTION$6);
            if (target == null)
            {
                target = (org.apache.xmlbeans.XmlString)get_store().add_attribute_user(DESCRIPTION$6);
            }
            target.set(description);
        }
    }
    
    /**
     * Unsets the "description" attribute
     */
    public void unsetDescription()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_attribute(DESCRIPTION$6);
        }
    }
    
    /**
     * Gets the "preconditions" attribute
     */
    public java.lang.String getPreconditions2()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(PRECONDITIONS2$8);
            if (target == null)
            {
                return null;
            }
            return target.getStringValue();
        }
    }
    
    /**
     * Gets (as xml) the "preconditions" attribute
     */
    public org.apache.xmlbeans.XmlString xgetPreconditions2()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_attribute_user(PRECONDITIONS2$8);
            return target;
        }
    }
    
    /**
     * True if has "preconditions" attribute
     */
    public boolean isSetPreconditions2()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().find_attribute_user(PRECONDITIONS2$8) != null;
        }
    }
    
    /**
     * Sets the "preconditions" attribute
     */
    public void setPreconditions2(java.lang.String preconditions2)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(PRECONDITIONS2$8);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(PRECONDITIONS2$8);
            }
            target.setStringValue(preconditions2);
        }
    }
    
    /**
     * Sets (as xml) the "preconditions" attribute
     */
    public void xsetPreconditions2(org.apache.xmlbeans.XmlString preconditions2)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_attribute_user(PRECONDITIONS2$8);
            if (target == null)
            {
                target = (org.apache.xmlbeans.XmlString)get_store().add_attribute_user(PRECONDITIONS2$8);
            }
            target.set(preconditions2);
        }
    }
    
    /**
     * Unsets the "preconditions" attribute
     */
    public void unsetPreconditions2()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_attribute(PRECONDITIONS2$8);
        }
    }
    
    /**
     * Gets the "postconditions" attribute
     */
    public java.lang.String getPostconditions2()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(POSTCONDITIONS2$10);
            if (target == null)
            {
                return null;
            }
            return target.getStringValue();
        }
    }
    
    /**
     * Gets (as xml) the "postconditions" attribute
     */
    public org.apache.xmlbeans.XmlString xgetPostconditions2()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_attribute_user(POSTCONDITIONS2$10);
            return target;
        }
    }
    
    /**
     * True if has "postconditions" attribute
     */
    public boolean isSetPostconditions2()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().find_attribute_user(POSTCONDITIONS2$10) != null;
        }
    }
    
    /**
     * Sets the "postconditions" attribute
     */
    public void setPostconditions2(java.lang.String postconditions2)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(POSTCONDITIONS2$10);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(POSTCONDITIONS2$10);
            }
            target.setStringValue(postconditions2);
        }
    }
    
    /**
     * Sets (as xml) the "postconditions" attribute
     */
    public void xsetPostconditions2(org.apache.xmlbeans.XmlString postconditions2)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_attribute_user(POSTCONDITIONS2$10);
            if (target == null)
            {
                target = (org.apache.xmlbeans.XmlString)get_store().add_attribute_user(POSTCONDITIONS2$10);
            }
            target.set(postconditions2);
        }
    }
    
    /**
     * Unsets the "postconditions" attribute
     */
    public void unsetPostconditions2()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_attribute(POSTCONDITIONS2$10);
        }
    }
    
    /**
     * Gets the "coreModel" attribute
     */
    public java.lang.String getCoreModel2()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(COREMODEL2$12);
            if (target == null)
            {
                return null;
            }
            return target.getStringValue();
        }
    }
    
    /**
     * Gets (as xml) the "coreModel" attribute
     */
    public org.apache.xmlbeans.XmlString xgetCoreModel2()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_attribute_user(COREMODEL2$12);
            return target;
        }
    }
    
    /**
     * True if has "coreModel" attribute
     */
    public boolean isSetCoreModel2()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().find_attribute_user(COREMODEL2$12) != null;
        }
    }
    
    /**
     * Sets the "coreModel" attribute
     */
    public void setCoreModel2(java.lang.String coreModel2)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(COREMODEL2$12);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(COREMODEL2$12);
            }
            target.setStringValue(coreModel2);
        }
    }
    
    /**
     * Sets (as xml) the "coreModel" attribute
     */
    public void xsetCoreModel2(org.apache.xmlbeans.XmlString coreModel2)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_attribute_user(COREMODEL2$12);
            if (target == null)
            {
                target = (org.apache.xmlbeans.XmlString)get_store().add_attribute_user(COREMODEL2$12);
            }
            target.set(coreModel2);
        }
    }
    
    /**
     * Unsets the "coreModel" attribute
     */
    public void unsetCoreModel2()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_attribute(COREMODEL2$12);
        }
    }
}
